package com.example.validdemo.service;


import com.example.validdemo.model.SysUser;
import com.example.validdemo.validator.Validator;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;
import org.springframework.validation.annotation.Validated;

import javax.validation.Valid;
import javax.validation.constraints.NotNull;

/**
 * @author Bx_Hu
 */
@Service
@Slf4j
@Validated
public class SysUserServiceImpl  {


    /**
     * 添加用户
     *
     * @param sysUser sysUser
     * @return sysUser
     */
    @Validated(Validator.Add.class)
    public SysUser saveUser(@Valid  SysUser sysUser,@NotNull String s) {
        log.warn("Service校验后的数据  sysUser = {}", sysUser);
        return sysUser;
    }


}
